
import { Entity,PrimaryGeneratedColumn,Column } from "typeorm";

export type TYPETYPE = '枚举1'|'枚举2'|'枚举3';,
@Entity()
class Author {
  
  // 作者编号
  @PrimaryGeneratedColumn()
  id: number;
        // 作者姓名
@Column({
type: "varchar",
nullable: true,
name: "name",
length: 20,
collation: "utf8_general_ci",
})
name: string;// 登陆密码
@Column({
type: "varchar",
nullable: true,
name: "password",
length: 255,
collation: "utf8_general_ci",
})
password: string;// 创建日期
@Column({
type: "date",
nullable: false,
name: "created_at",
})
created_at: Date;// 枚举类型
@Column({
type: "enum",
enum: ['枚举1','枚举2','枚举3'],
nullable: false,
name: "type",
collation: "utf8_general_ci",
})
type: TYPETYPE;// 哈哈
@Column({
type: "float",
nullable: true,
name: "hah",
zerofill: false,
unsigned: true,
})
hah: number;// 测试
@Column({
type: "double",
nullable: false,
name: "ceshi",
length: 11,
precision: 1,
zerofill: false,
unsigned: false,
})
ceshi: number;
}
